package com.koo.modules.purchase.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.koo.common.base.entity.CommonEntity;
import com.koo.common.utils.MyDateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author charlin
 * @email 136137465@qq.com
 * @date 2023-03-15 14:06:00
 */
@Data
@ApiModel("")
@TableName("purchases_back_order")
public class PurchasesBackOrderEntity extends CommonEntity {
    private static final long serialVersionUID = 1L;
    @ExcelIgnore
    @TableId
    private Long backId;

    @ColumnWidth(11)
    @ExcelProperty("退货单号")
    @ApiModelProperty(value = "退货单号")
    private String backNo;

    @ColumnWidth(11)
    @ExcelProperty("入库ID")
    @ApiModelProperty(value = "入库ID")
    private Long inboundId;

    @ColumnWidth(11)
    @ExcelProperty("入库单号")
    @ApiModelProperty(value = "入库单号")
    private String inboundNo;

    @ColumnWidth(11)
    @ExcelProperty("供应商id")
    @ApiModelProperty(value = "供应商id")
    private Long supplierId;

    @ColumnWidth(11)
    @ExcelProperty("供应商名称")
    @ApiModelProperty(value = "供应商名称")
    private String supplierName;

    @DateTimeFormat(pattern = MyDateUtil.DATE_TIME_PATTERN)
    @JsonFormat(pattern = MyDateUtil.DATE_TIME_PATTERN, timezone = "GMT+8")
    @ColumnWidth(11)
    @ExcelProperty("退货日期")
    @ApiModelProperty(value = "退货日期")
    private Date backDate;

    @ColumnWidth(11)
    @ExcelProperty("总金额")
    @ApiModelProperty(value = "总金额")
    private BigDecimal totalFee;

    @DateTimeFormat(pattern = MyDateUtil.DATE_PATTERN)
    @JsonFormat(pattern = MyDateUtil.DATE_PATTERN, timezone = "GMT+8")
    @ColumnWidth(11)
    @ExcelProperty("总部日期")
    @ApiModelProperty(value = "总部日期")
    private Date headQuarterDate;

    @ColumnWidth(11)
    @ExcelProperty("总部单号")
    @ApiModelProperty(value = "总部单号")
    private String headQuarterNo;

    @ColumnWidth(11)
    @ExcelProperty("取消状态1取消")
    @ApiModelProperty(value = "取消状态1取消")
    private Integer cancelState;

    @ColumnWidth(11)
    @ExcelProperty("退货人id")
    @ApiModelProperty(value = "退货人id")
    private Long backUserId;

    @ColumnWidth(11)
    @ExcelProperty("退货人")
    @ApiModelProperty(value = "退货人")
    private String backUser;

    @ColumnWidth(11)
    @ExcelProperty("审核人id")
    @ApiModelProperty(value = "审核人id")
    private Long auditUserId;

    @ColumnWidth(11)
    @ExcelProperty("审核人")
    @ApiModelProperty(value = "审核人")
    private String auditUser;

    @ColumnWidth(11)
    @ExcelProperty("审核状态")
    @ApiModelProperty(value = "审核状态")
    private Integer auditStatus;

    @ColumnWidth(11)
    @ExcelProperty("审核说明")
    @ApiModelProperty(value = "审核说明")
    private String auditNote;

    @ExcelIgnore
    @TableField(exist = false)
    private List<PurchasesBackOrderDetailEntity> itemList;

}
